package view.inventory.menu
{
import core.Language;

import framework.view.components.button.ButtonProxy;

import values.item.EquipmentItemValue;

import view.inventory.EquipmentSelectionUI;

/**
 * HeroEquipmentMenu
 * @author jliang
 *
 */
public class HeroEquipmentMenu extends InventoryItemMenuProxy
{
	//==========================================================================
	//  Constructor
	//==========================================================================
	public function HeroEquipmentMenu()
	{
		super();
	}
	//==========================================================================
	//  Overridden methods: ComponentProxy
	//==========================================================================	
	override protected function get proxyMapping():Array
	{
		return [ 
			{ skin:"unequipBtn", classRef: ButtonProxy, id:"unequipBtn", text:Language.getText("@unequip_button_label"), onClick: unequipHandler },
			{ skin:"changeBtn", classRef: ButtonProxy, id:"changeBtn", text:Language.getText("@change_equipment_button_label"), onClick: changeEquipmentHandler },
			{ skin:"upgradeBtn", classRef: ButtonProxy, id:"upgradeBtn", text:Language.getText("@upgrade_button_label"), onClick: upgradeHandler },
			{ skin:"forgingBtn", classRef: ButtonProxy, id:"forgingBtn", text:Language.getText("@forging_button_label"), onClick: forgingHandler }
		];
	}	
	//==========================================================================
	//  Event handlers
	//==========================================================================
	protected function upgradeHandler():void
	{
		
	}
	
	protected function forgingHandler():void
	{
		
	}
	
	protected function unequipHandler():void
	{
		var item:EquipmentItemValue = data as EquipmentItemValue;
		
		item.owner.removeEquipment(item);
	}
	
	protected function changeEquipmentHandler():void
	{
		var item:EquipmentItemValue = data as EquipmentItemValue;
		
		EquipmentSelectionUI.showEquipment(item.owner, item);
	}
}
}


